<script setup>
import {
  Check,
  Delete,
  Edit,
  Message,
  Search,
  Star,
  Terminal
} from "@element-plus/icons-vue";
import { onMounted } from 'vue';

// 页面加载时添加动画效果
onMounted(() => {
  setTimeout(() => {
    document.querySelectorAll('.tech-card').forEach((card, index) => {
      setTimeout(() => {
        card.classList.add('visible');
      }, index * 200);
    });
  }, 100);
});
</script>
<template>
  <div class="ep-container">
    <div class="page-header">
      <div class="header-decoration"></div>
      <h2 class="page-title">
        <Terminal class="title-icon" />
        组件展示
      </h2>
      <div class="header-glow"></div>
    </div>

    <div class="tech-card button-example">
      <div class="card-header">
        <h3>按钮组件展示</h3>
        <div class="card-decorator"></div>
      </div>
      
      <div class="button-section">
        <h4 class="section-title">主要按钮</h4>
        <div class="button-row">
          <el-button class="tech-btn">Default</el-button>
          <el-button type="primary" class="tech-btn primary-btn">Primary</el-button>
          <el-button type="success" class="tech-btn success-btn">Success</el-button>
          <el-button type="info" class="tech-btn info-btn">Info</el-button>
          <el-button type="warning" class="tech-btn warning-btn">Warning</el-button>
          <el-button type="danger" class="tech-btn danger-btn">Danger</el-button>
        </div>
      </div>

      <div class="button-section">
        <h4 class="section-title">朴素按钮</h4>
        <div class="button-row">
          <el-button plain class="tech-btn">Plain</el-button>
          <el-button type="primary" plain class="tech-btn primary-btn">Primary</el-button>
          <el-button type="success" plain class="tech-btn success-btn">Success</el-button>
          <el-button type="info" plain class="tech-btn info-btn">Info</el-button>
          <el-button type="warning" plain class="tech-btn warning-btn">Warning</el-button>
          <el-button type="danger" plain class="tech-btn danger-btn">Danger</el-button>
        </div>
      </div>

      <div class="button-section">
        <h4 class="section-title">图标按钮</h4>
        <div class="button-row">
          <el-button type="primary" icon="el-icon-search" class="tech-btn primary-btn"></el-button>
          <el-button type="primary" icon="el-icon-edit" class="tech-btn primary-btn"></el-button>
          <el-button type="primary" icon="el-icon-check" class="tech-btn primary-btn"></el-button>
          <el-button type="primary" icon="el-icon-message" class="tech-btn primary-btn"></el-button>
          <el-button type="primary" icon="el-icon-delete" class="tech-btn primary-btn"></el-button>
          <el-button type="primary" icon="el-icon-star" class="tech-btn primary-btn"></el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
/* 科技感主题样式 */
.ep-container {
  padding: 20px;
  background: #0d1117;
  min-height: 100%;
}

/* 页面标题区域 */
.page-header {
  position: relative;
  margin-bottom: 30px;
  padding-bottom: 15px;
}

.page-title {
  font-size: 24px;
  color: #58a6ff;
  margin: 0;
  position: relative;
  z-index: 2;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  font-size: 28px;
  animation: pulse 2s infinite;
}

.header-decoration {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, #58a6ff, transparent);
}

.header-glow {
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 150px;
  height: 1px;
  background: #58a6ff;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

/* 卡片容器 */
.tech-card {
  border-radius: 12px;
  border: 1px solid #30363d;
  background: rgba(22, 27, 34, 0.8);
  padding: 25px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease-out;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #58a6ff, transparent);
}

.tech-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片头部 */
.card-header {
  position: relative;
  margin-bottom: 25px;
  padding-bottom: 10px;
}

.card-header h3 {
  color: #58a6ff;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.card-decorator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #58a6ff, transparent);
}

/* 按钮区域 */
.button-section {
  margin-bottom: 30px;
  position: relative;
}

.button-section:last-child {
  margin-bottom: 0;
}

.section-title {
  color: #c9d1d9;
  margin: 0 0 15px 0;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 按钮行 */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  padding: 15px;
  background: rgba(13, 17, 23, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.5);
}

/* 科技感按钮样式 */
.tech-btn {
  border-radius: 8px;
  padding: 10px 20px;
  transition: all 0.3s ease;
  font-weight: 500;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

/* 按钮悬停效果 */
.tech-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}

/* 主按钮样式 */
.primary-btn {
  background: linear-gradient(90deg, #58a6ff, #1d6fe2);
  border-color: #58a6ff;
}

.primary-btn:hover {
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.4);
}

/* 成功按钮样式 */
.success-btn {
  background: linear-gradient(90deg, #3fb950, #238636);
  border-color: #3fb950;
}

.success-btn:hover {
  box-shadow: 0 4px 20px rgba(63, 185, 80, 0.4);
}

/* 信息按钮样式 */
.info-btn {
  background: linear-gradient(90deg, #6e7681, #484f58);
  border-color: #6e7681;
}

.info-btn:hover {
  box-shadow: 0 4px 20px rgba(110, 118, 129, 0.4);
}

/* 警告按钮样式 */
.warning-btn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-color: #f59e0b;
}

.warning-btn:hover {
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* 危险按钮样式 */
.danger-btn {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  border-color: #ef4444;
}

.danger-btn:hover {
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

/* 图标按钮特殊效果 */
.tech-btn:deep(.el-icon) {
  transition: all 0.3s ease;
}

.tech-btn:hover:deep(.el-icon) {
  transform: scale(1.2);
}

/* 动画效果 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.8);
  }
  100% {
    box-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ep-container {
    padding: 15px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  .title-icon {
    font-size: 24px;
  }
  
  .tech-card {
    padding: 20px;
  }
  
  .button-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .tech-btn {
    width: 100%;
    justify-content: center;
  }
}
</style>
